package com.xiaoma;

import com.xiaoma.initializer.DemoApplicationContextInitializer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @description  
 * @author wangtianxiang
 * @date: 2021/11/15 11:37
 */
@Slf4j
@SpringBootApplication
public class Application implements CommandLineRunner {

    @Value("${age}")
    private int age;

    public static void main(String[] args) {
      /*  SpringApplication springApplication = new SpringApplication(Application.class);
        springApplication.addInitializers(new DemoApplicationContextInitializer());
        springApplication.run(args);*/
        SpringApplication.run(Application.class,args);
    }


    @Override
    public void run(String... args) throws Exception {
        log.info("age: {}", age);
    }
}
